package DSENS;

/**
 *
 * @author teeteto
 */
import java.util.ArrayList;


class GlobalInfo{
    public static String CODE = new String("Ex_00001");
    public static int NoNodes = 100;
    public static int WirelessRange = 100;
    public static long SEED = 234;
    public static int round = 5000;
    public static TimeLine TIMELINE = new TimeLine(100000);
}


public class SchedulingOnGridSimulator {

   public static void main(String args[]) {
    try{
        Log l = new Log();
        Node.NodeState st = null;
        ArrayList<Node> net = new ArrayList<Node>(GlobalInfo.NoNodes);
        
                
        GridNetworkManager gnm = new GridNetworkManager(net);
        gnm.initNetworks();
        for(int i=0;i<net.size();i++) l.printNode(net.get(i));
        
        //manage event
        Message msg = new Message(2);
        Event ev = new Event(0,0,"job",0,msg); //genera evento da 0 a 0
        GlobalInfo.TIMELINE.addEvent(0, ev); //inserisci in slot 0

        //Create Event Manager
        EventManager em = new EventManager();

        //run simulation
        System.out.println("Run simulation...");
        while(em.execEvent(net)!=false){}
        
    }catch(LogException le){
        le.printStackTrace();
    }
   }   
}
